package org.itboys.promotion.entity;

import java.math.BigDecimal;

import org.itboys.mongodb.entity.BaseLongIdEntity;

import org.mongodb.morphia.annotations.Entity;

/**
 * 优惠券
 * @author 土豪章
 *
 */
@Entity(value = "Coupon", noClassnameStored = true)
public class Coupon  extends BaseLongIdEntity{

	private static final long serialVersionUID = -6934926333399625449L;
	
	private String name;// 优惠券名称
	private BigDecimal costMoney;// 满多少才生效
	private BigDecimal subtractMoney;// 满多少减多少 如果 type 为直接抵用券 则为
	private long startTime;// 有效期
	private long endTime;// 失效时间 为0不失效
	private boolean validityPeriod;// 领取后是否限制使用 时间
	private int invalidUnit;// 如果 validityPeriod 为true 则为 限制使用 单位 1:天 2:小时 3:分 4:秒
	private int invalid;// 如果 validityPeriod 为true 则为 invalidUnit 对应的值
	private int total;// 总张数 0 不限制
	private int dayLimit;// 每天最多发放多少
	private int userLimit;// 没人最多领取多少
	private int userDayLimit;// 没人每天最多领取多少
	private int newAccount;// 是否只限制新手才领取
	private int type;//优惠券类型 1:满减券 2:直接抵用券 其他的自己定义类型
	private String logo;//代金券logo if 需要
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public BigDecimal getCostMoney() {
		return costMoney;
	}

	public void setCostMoney(BigDecimal costMoney) {
		this.costMoney = costMoney;
	}

	public BigDecimal getSubtractMoney() {
		return subtractMoney;
	}

	public void setSubtractMoney(BigDecimal subtractMoney) {
		this.subtractMoney = subtractMoney;
	}

	public long getStartTime() {
		return startTime;
	}

	public void setStartTime(long startTime) {
		this.startTime = startTime;
	}

	public long getEndTime() {
		return endTime;
	}

	public void setEndTime(long endTime) {
		this.endTime = endTime;
	}

	public boolean isValidityPeriod() {
		return validityPeriod;
	}

	public void setValidityPeriod(boolean validityPeriod) {
		this.validityPeriod = validityPeriod;
	}

	public int getInvalidUnit() {
		return invalidUnit;
	}

	public void setInvalidUnit(int invalidUnit) {
		this.invalidUnit = invalidUnit;
	}

	public int getInvalid() {
		return invalid;
	}

	public void setInvalid(int invalid) {
		this.invalid = invalid;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getDayLimit() {
		return dayLimit;
	}

	public void setDayLimit(int dayLimit) {
		this.dayLimit = dayLimit;
	}

	public int getUserLimit() {
		return userLimit;
	}

	public void setUserLimit(int userLimit) {
		this.userLimit = userLimit;
	}

	public int getUserDayLimit() {
		return userDayLimit;
	}

	public void setUserDayLimit(int userDayLimit) {
		this.userDayLimit = userDayLimit;
	}

	public int getNewAccount() {
		return newAccount;
	}

	public void setNewAccount(int newAccount) {
		this.newAccount = newAccount;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}
}
